home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 10248 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: keats.ugrad.cs.ubc.ca!not-for-mail
  2. From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: ** Disabling ctrl-C in C **
  5. Date: 15 Mar 1996 20:41:49 -0800
  6. Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
  7. Message-ID: <4idgqdINNopn@keats.ugrad.cs.ubc.ca>
  8. References: <4hpbv3$6u@maltese.eag.unisysgsg.com> <31435190.45C2@post.drexel.edu> <826935500snz@genesis.demon.co.uk>
  9. NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
  10.  
  11. In article <826935500snz@genesis.demon.co.uk>,
  12. Lawrence Kirby  <fred@genesis.demon.co.uk> wrote:
  13.  
  14.  >>ioctl (0,TCSETAF, &termnew);   /*terminal now ignores signals*/
  15.  
  16. By the way he surely meant to say /*terminal driver now doesn't generate sigs*/
  17.  
  18. Nothing is ignored; signals simply not generated anymore.
  19.  
  20.  >>if (ioctl (0,TCSETAF,&term_init);  /*sets terminal back to initial conditions*/
  21.  >
  22.  >That seems an excessively long-winded and non-portable way of writing:
  23.  >
  24.  >#include <signal.h>
  25.  >
  26.  >    signal(SIGINT, SIG_IGN);
  27.  
  28.  
  29.  >:-)
  30.  
  31. Not to mention that the ioctl(.. TCSETAF...) style of terminal control is
  32. completely obsoleted by POSIX.1.
  33.  
  34. The proper way is tcgetattr()/tcsetattr().
  35.  
  36. This is must be available on any system that claims POSIX compliance.
  37.  
  38. Off topic. Sigh.
  39. -- 
  40.  
  41.